Skip to content

[WIP] Cleanup of Wavelet and TSLess stuff - #81

Closed
ilfreddy wants to merge 14 commits into
PCMSolver:release/1.Yfrom
ilfreddy:cleanup75
Closed

ilfreddy wants to merge 14 commits into
PCMSolver:release/1.Yfrom
ilfreddy:cleanup75

Conversation

@ilfreddy

@ilfreddy ilfreddy commented Jul 4, 2017

Copy link
Copy Markdown
Collaborator

Description

Removal of code related to Wavelets and TsLess cavity which is not present in the released version

How Has This Been Tested?

All tests, except the standalone ones now pass

Todos

Standalone tests shall be fixed

ilfreddy added 4 commits June 30, 2017 12:20
First step in the cleanup of the python parser. Now one of the failed tests is passing again (switched from wavelet to gepol cavity).
Some parameter changed to accommodate for a GEPOL cavity instead of a WAVELET one
Some cleanup in Input.cpp removing wavelet related stuff
All tsless stuff removed from the test and test file renamed as cpcm
Most tests now pass. The standalone tests complain about PATCHLEVEL but a "git grep PATCHLEVEL" gives no matching instance. Puzzling...
@bast

bast commented Jul 4, 2017

Copy link
Copy Markdown
Member

The todo part is part of this PR - in other words work in progress or is it to be done after this PR is accepted?

@ilfreddy

ilfreddy commented Jul 4, 2017

Copy link
Copy Markdown
Collaborator Author

The todos is something I have not managed to fix yet. Roberto will have a look. This PR is still WIP, although I have not marked it as such.

@robertodr

Copy link
Copy Markdown
Member

Thanks for the PR. In Markdown the - [ ] are rendered as checkboxes, so you can leave them unchecked to signal discussion points and/or WIP status. For example:

  • Not done (rendered from - [ ] Not done
  • Done (rendered from - [x] Done)

I would prefer that the title of the PR clearly states if it's WIP or not.

@robertodr robertodr changed the title Cleanup of Wavelet and TSLess stuff [WIP] Cleanup of Wavelet and TSLess stuff Jul 4, 2017

@robertodr robertodr left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks! There are some further things to fix:

  1. The function int integralEquation(const std::string & name) is no longer needed and you should remove it from Input.cpp, so that it doesn't generate compiler warnings.
  2. The PCMInput struct, defined in PCMInput.h should also be purged of the, now useless, input parameters.
  3. There are still some things in the Python input script that lead nowhere, like METALSPHERE and GREENSFUNCTIONSUM.
  4. The changes should be documented in the CHANGELOG.md file. Especially Point 2 above, which will be API-breaking.
  5. You should also go through the documentation of the input, to check that everything matches.

Comment thread src/cavity/CavityData.hpp
@@ -45,20 +45,11 @@ struct CavityData {
/*! The minimal distance between two sampling points on different spheres. Relevant
* for TsLessCavity */
double minDistance;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter should also be purged!

Comment thread src/cavity/CavityData.hpp
: molecule(_molec),
area(_area),
probeRadius(_probeRadius),
minDistance(_minDistance),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed too.

Comment thread src/interface/Input.cpp
area_ = host_input.area * angstrom2ToBohr2();
patchLevel_ = host_input.patch_level;
coarsity_ = host_input.coarsity * angstromToBohr();
minDistance_ = host_input.min_distance * angstromToBohr();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this one should be removed.

Comment thread src/cavity/CavityData.hpp
@@ -67,22 +58,14 @@ struct CavityData {
double _area,
double _probeRadius,
double _minDistance,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter should be removed from the constructor.

Comment thread src/interface/Input.cpp Outdated
@@ -366,12 +355,8 @@ CavityData Input::cavityParams() const {
area_,
probeRadius_,
minDistance_,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter should be removed.

Comment thread src/interface/Input.hpp
double coarsity_;
/// GePol and TsLess cavities average element area
double area_;
/// TsLess cavity minimal distance between sampling points

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines should be removed as well.

double diagonalScaling = 1.0694;
std::string radiiSet = "UFF";
double minimalRadius = 0.1 * angstromToBohr();
double minimalRadius = 0.3 * angstromToBohr();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a check added on the minimal radius parameter.

REQUIRE(type == parsedInput.cavityType());
REQUIRE(patchLevel == parsedInput.cavityParams().patchLevel);
REQUIRE(coarsity == Approx(parsedInput.cavityParams().coarsity));
REQUIRE(area == Approx(parsedInput.cavityArea()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get the area from cavityParams().area, instead of adding a new getter to the input object.

int patchLevel = 1;
double coarsity = 0.3;
std::string type = "GEPOL";
double area = 0.3 * angstromToBohr() * angstromToBohr();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an angstrom2ToBohr2() function available for this in PhysicalConstants.cpp

Comment thread tools/pcmsolver.py.in
# Default: 0.3 au^2
# Valid for: GePol cavity
# Valid values: double strictly greater than 0.01 Angstrom^2
# Default: 0.3 Angstrom^2 (later converted to 1.07132... au^2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The minimal input assumes atomic units as defaults, as such the default for areas really is 0.3 AU^2 We should maybe re-set the default to the AU^2 value of 0.3 Angstrom^2, instead of having this oblique comment in the script.

robertodr and others added 10 commits July 4, 2017 17:16
First step in the cleanup of the python parser. Now one of the failed tests is passing again (switched from wavelet to gepol cavity).
Some parameter changed to accommodate for a GEPOL cavity instead of a WAVELET one
Some cleanup in Input.cpp removing wavelet related stuff
All tsless stuff removed from the test and test file renamed as cpcm
Most tests now pass. The standalone tests complain about PATCHLEVEL but a "git grep PATCHLEVEL" gives no matching instance. Puzzling...
@bast

bast commented Jul 5, 2017

Copy link
Copy Markdown
Member

You can avoid the merge commit with git pull --rebase. Only downside of this is that if you have a conflict, then it looks a bit more hairy to resolve. But if you work on separate branches, this should not happen.

@ilfreddy

ilfreddy commented Jul 5, 2017

Copy link
Copy Markdown
Collaborator Author

I have followed roberto's instructions. We were just commenting about how the whole structure is getting a bit overwhelming at times (understatement)...

@bast

bast commented Jul 5, 2017

Copy link
Copy Markdown
Member

What parts exactly are overwhelming? I am asking this so that we either improve docs or perhaps write up a guide or blog post.

@ilfreddy

ilfreddy commented Jul 5, 2017

Copy link
Copy Markdown
Collaborator Author

I will try to make a (very) long story a bit shorter.

  1. Concerning this commit
    I needed to rebase my branch in order to make sure that my changes would then come on top of what roberto has done with the following sequence
    git pull --rebase upstream release/1.Y
    git checkout claenup75
    git rebase -i release/1.Y
    Ignoring the fact that I would not have been able to figure this out myself, this is a bit of an overkill when I could have simply merged my branch and filed a new PR later.

  2. Concerning what I am doing now
    I am removing dead parts of the code which are just "littering" the released branch. Doing this correctly (right way of committing, right way of running the test, figuring out how the test work etc...) is not exactly straightforward and although I don't regard myself as very confident with all these tools (git, github, ctest, travis) I am not a complete newby either. If a task so simple requires me three full days of work, I have no chance of getting back to a state where I can confidently do meaningful code development again. As a matter of fact I also get reminded when I push something that it's good that I have done it but maybe I should have better done it in a different way, which makes me (and for sure others who are less confident than me) afraid of doing anything for the fear of doing it wrong.

  3. Concerning a broader perspective
    PCMSolver, MRChem or other codes should in principle be used as tools by others or accept contributions from other researchers (PhD students, postdocs). If the task of implementing anything becomes so daunting that only people who are extremely skilled professional developers can do it right (you two @bast and @robertodr are way above the average skill level I can expect to find in general) then the codes themselves are doomed the moment such people will leave the business.

@bast

bast commented Jul 5, 2017

Copy link
Copy Markdown
Member

Thanks for the very good points - indeed we have to be careful that we don't push people out with our better tools and workflows.

@bast

bast commented Jul 5, 2017 •

Copy link
Copy Markdown
Member

Just a hint for problem 1):
Assuming that you have no modifications to release/1.Y on your fork or local clone you could have done this (which is perhaps easier since no interactive work needed):

$ git fetch upstream
$ git checkout cleanup75
$ git rebase upstream/release/1.Y

@robertodr

robertodr commented Jul 5, 2017 •

Copy link
Copy Markdown
Member

For problem 1, there's a technical solution and once we agree upon it, it will become easily second nature.
For problem 2, I guess that's my fault. Maybe the code is too contrived? Or the infrastructure around it is? I don't know. I know that I can work with it, but that doesn't matter. If it's difficult, it has to be simplified. But I can't do it on my own, because for me it's crystal clear how stuff works...
For problem 3, see problem 2 above. I don't have a solution (right now, at least)

@ilfreddy

ilfreddy commented Jul 5, 2017

Copy link
Copy Markdown
Collaborator Author

il_freddy [11:53 AM]
I don’t think it is your fault. I think we need to make sure that in general the required learning curve to start doing something meaningful in the code is reduced. F77 has a number of defects but one clear virtue: WYSIWYG 🙂 In other words, nothing hides behind the line of code you are currently reading. Knowing something more is just a print statement away.
the ctest/travis/github/git/cmake/python/c++ infrastructure is quite a lot to learn before one even attempts at writing code. And many of the tools are meant to “help” by hiding tedious details behind the curtains. Fixing a failed test requires knowledge at all such levels:

  1. How is a test run and where is the output written?
  2. Which executables are indeed used for the test and how do I make the test by hand
  3. How is CMake producind the tests from the source code
  4. Which tests are just python stuff and which ones are also executing the C++ code
  5. What is hiding behind a given C++ line? (inheritance issues, include files, libraries, global stuff…)
  6. How do I (properly) commit the changes?
    (These are the things I stumbled upon in the last two days ;-) )

@robertodr

Copy link
Copy Markdown
Member

Have you checked the documentation? If this stuff is missing, add it or add an issue on the repo to keep track of it.

@ilfreddy

ilfreddy commented Jul 6, 2017

Copy link
Copy Markdown
Collaborator Author

I seem to recall we don't have much about running test and what to do when they give wrong answers, although the documentation for writing new tests seems good to me. I will try to add something there now that my experience with these problems is fresh!

@robertodr

Copy link
Copy Markdown
Member

I might not have kept up with the documentation work lately, that's true.

@robertodr

Copy link
Copy Markdown
Member

@ilfreddy status on this?

@ilfreddy

ilfreddy commented Oct 19, 2017 via email

Copy link
Copy Markdown
Collaborator Author

robertodr added a commit to robertodr/pcmsolver that referenced this pull request Nov 23, 2017
@robertodr

Copy link
Copy Markdown
Member

I have incorporated this changeset into #107

robertodr added a commit to robertodr/pcmsolver that referenced this pull request Nov 26, 2017
robertodr added a commit to robertodr/pcmsolver that referenced this pull request Nov 28, 2017
@robertodr

Copy link
Copy Markdown
Member

Superseded by #107. Closing.

@robertodr robertodr closed this Nov 30, 2017
robertodr added a commit to robertodr/pcmsolver that referenced this pull request Dec 28, 2017
robertodr added a commit that referenced this pull request Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants